<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="Tronke.Ajax.js"></script>
</head>
<body>
<form id="myform">
    <input type="text" placeholder="用户名"/>
    <input type="password" placeholder="密码"/>
    <input type="text" placeholder="地址"/>
    <input type="text" placeholder="年纪"/>
    <input type="text" placeholder="QQ"/>
    <input type="text" placeholder="TelPhone"/>
    <input type="text" placeholder=" UserName"/>
    <input type="button" value="提交"/>
</form>
</body>
</html>
<script>
    //    注册
    //    http://10.36.132.104/userinfo/regUser
    //        post
    //    参数
    //    LoginName
    //    LoginPwd
    //    Address
    //    Age 最大的120 做小18
    //    QQ  {5,13}
    //    TelPhone 不能重复
    //    UserName  不能重复
    var oform = document.getElementById('myform');
    var ipt = oform.children;

    var btn = ipt[7];
    btn.onclick = function(){
        var userName = ipt[0].value;
        var userPwd = ipt[1].value;
        var userAddrss = ipt[2].value;
        var userAge = ipt[3].value;
        var userQQ = ipt[4].value;
        var userTelPhone = ipt[5].value;
        var userName1 = ipt[6].value;
        ajax({
            url : "http://10.36.132.104/userinfo/regUser",
            type : "post",
            async:"true",
            data : {
                "LoginName" : userName,
                "LoginPwd" : userPwd,
                "QQ" : userQQ,
                'Address' : userAddrss,
                "Age" : userAge,
                "TelPhone" : userTelPhone,
                "UserName" : userName1
            },
            dataType : "json",
            success : function(result){
                console.log(result);
                alert("登陆成功");
                window.location.assign("登陆页面.html")
            }

        });

    }


</script>